
// button object
local PANEL = {};


/*------------------------------------
	set checkbox text
------------------------------------*/
function PANEL:SetText( text )

	// check if we have a label
	if ( !self.Label ) then
	
		// create the label
		self.Label = vgui.Create( "MXLabel", self );
		
		// enable mouse input
		self.Label:SetMouseInputEnabled( true );
		
		// setup mouse released function
		self.Label.OnMouseReleased = function()
		
			// toggle value
			self:Toggle();
			
		end
		
	end
	
	// set the text
	self.Label:SetText( text );
	
	// refresh layout
	self:InvalidateLayout();

end

// define
derma.DefineControl( "MXCheckBoxLabel", "", PANEL, "DCheckBoxLabel" );
